package com.maduar.demo.designPattern;

/**
 * Description:
 *
 * @author danny.pang danny.pang@ebizprise.com
 * @date 2020-03-08 23:59
 */
public class OperationFactory {

    public static Operation createOperate(OperationEnum operate) {

        Operation operation = null;

        switch (operate) {
            case ADD:
                operation = new OprationAdd();
                break;
            case SUB:
                operation = new OprationSub();
                break;
//            case ADD:
//                operation = new OprationAdd();
//                break;
//            case ADD:
//                operation = new OprationAdd();
//                break;
            default:
                operation = new OprationAdd();
                break;
        }

        return operation;
    }
}
